package com.tang.factory;

import com.tang.pojo.ScheduleJob;
import com.tang.support.TaskUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * @author 唐一菲
 * @Description: 计划任务执行处 无状态
 */
public class QuartzJobFactory implements Job {

//	private static final Logger logger = LogManager.getLogger(QuartzJobFactory.class);

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
        TaskUtils.invokMethod(scheduleJob);
    }
}